package cn.haixiang.controller;

import cn.haixiang.domain.User;
import cn.haixiang.feignclient.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: java0806-springcloud-netflix
 * @BelongsPackage: cn.itsource.cn.itsource.controller
 * @Author: shezhan
 * @CreateTime: 2022-12-19  09:26
 * @Description: TODO
 * @Version: 1.0
 */
@RestController
@RequestMapping("/pay")
public class PayController {

    @Autowired
    private UserService userService;

    @GetMapping("/{id}")
    public User getUser(@PathVariable("id") Long id){
        // 使用openFeign调用user服务
        return userService.getUser(id);
//        User user = userService.getUser(id);
//        if (user.getId().equals(-1L)){
//            return user;
//        }
//        // 这一坨是业务
//        System.out.println("111");
//        System.out.println("222");
//        System.out.println("333");
//        System.out.println("444");
//        return user;
    }

}